﻿// Copyright richyp 2009
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing.Drawing2D;

namespace Richyp.Bodger.UI {
    public partial class WargearHeaderControl : UserControl {
        public WargearHeaderControl() {
            InitializeComponent();
            this.SetStyle(
                ControlStyles.OptimizedDoubleBuffer,
                true
                );
        }

        protected override void OnPaint(PaintEventArgs e) {
            base.OnPaint(e);
            e.Graphics.Clear(SystemColors.Control);
            try {                
                LinearGradientBrush lgb = new LinearGradientBrush(
                    e.ClipRectangle,
                    SystemColors.ActiveCaption,
                    SystemColors.GradientActiveCaption,
                    90
                    );
                e.Graphics.FillRectangle(lgb, e.ClipRectangle);
                e.Graphics.DrawString(this.Text, this.Font, SystemBrushes.ActiveCaptionText, e.ClipRectangle);
                e.Graphics.DrawRectangle(SystemPens.ActiveCaption, 0,0, this.Width-1,this.Height-1);
            } catch (Exception ex) { }
        }
    }
}
